/*
 * @Author: chen haoxuan
 * @Date: 2021-06-04 23:10:18
 * @LastEditTime: 2021-06-04 23:14:38
 */
#include <iostream>
#include <string>
using namespace std;
class Student
{
public:
  void get_value()
  {
    cout << "Please enter num, name, sex: " << endl;
    cin >> num >> name >> sex;
  }
  void display()
  {
    cout << "num: " << num << endl;
    cout << "name: " << name << endl;
    cout << "sex: " << sex << endl;
  }

private:
  int num;
  string name;
  char sex;
};
class Student1 : protected Student
{
public:
  void get_value1()
  {
    get_value();
    cout << "Please enter age, address: " << endl;
    cin >> age >> addr;
  }
  void display1()
  {
    display();
    cout << "age: " << age << endl;
    cout << "addr: " << addr << endl;
  }

private:
  int age;
  string addr;
};
int main()
{
  Student1 stud1;
  stud1.get_value1();
  stud1.display1();
  system("pause");
  return 0;
}